package com.youlai.boot.system.mapper;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youlai.boot.system.model.entity.LpsWl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.system.model.query.LpsWlQuery;
import com.youlai.boot.system.model.vo.LpsWlVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.Collection;
import java.util.List;

/**
 * 物料Mapper接口
 *
 * @author lwb
 * @since 2025-07-16 21:52
 */
@Mapper
public interface LpsWlMapper extends BaseMapper<LpsWl> {

    /**
     * 获取物料分页数据
     *
     * @param page 分页对象
     * @param queryParams 查询参数
     * @return
     */
    Page<LpsWlVO> getLpsWlPage(Page<LpsWlVO> page, LpsWlQuery queryParams);

    /**
     *
     * @param noList
     * @return
     */
    default List<LpsWl> getByNoList(Collection<String> noList){
        LambdaQueryWrapper<LpsWl> lqw = new LambdaQueryWrapper<>();
        if (CollUtil.isNotEmpty(noList)){
            lqw.in(LpsWl::getNo, noList);
        }
        return selectList(lqw);
    }
}
